﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HeroBattleLua
{
    public static void Lua2C_EnterBattle(string reportDetail, int battleType)
    {
        if (string.IsNullOrEmpty(reportDetail))
        {
            reportDetail = Resources.Load("HeroFight/HeroBattleJson_7").ToString();
        }
        Debug.Log(reportDetail);
        HeroBattleStage heroStage = GameStageMachine.Instance.GetStage(GameStageType.HeroBattle) as HeroBattleStage;
        heroStage.SetReportDetail(reportDetail, battleType);
        GameStageMachine.Instance.ChangeStage(GameStageType.HeroBattle);
    }

    // lua 2 c#
    public static void Lua2C_ExitBattle()
    {

    }

    // c# 2 lua
    public static void C2Lua_LoadBattleUi()
    {
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.LoadHeroBattleUI");
    }

    // lua 2 c#
    public static void Lua2C_BattleUiLoadDone()
    {
        HeroBattleStage heroStage = GameStageMachine.Instance.GetStage(GameStageType.HeroBattle) as HeroBattleStage;
        heroStage.OnLoad_UiDone();
    }

    //c# 2 lua
    //所有资源加载完毕 开始战斗
    public static void C2Lua_StartFight(HeroBattleStage.BattleBigType bigType)
    {
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.StartFight",(int)bigType);
    }

    //C# 2 lua
    //播放 开始战斗UI动画
    public static void C2Lua_StartUIAni()
    {
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.StartUIAni");
    }

    //Lua 2 C#
    //开始战斗UI动画结束
    public static void Lua2C_StartUIEnd()
    {
        if(GameStageMachine.Instance.GetCurStageType == GameStageType.HeroBattle)
        {
            HeroBattleStage heroStage = GameStageMachine.Instance.GetStage(GameStageType.HeroBattle) as HeroBattleStage;
            if (heroStage != null && heroStage.EBattleBigType == HeroBattleStage.BattleBigType.Slg)
            {
                SlgBattleMgr.Instance.StepCenterUIAniEnd();
            }
        }
    }

    //C# 2 Lua
    //显示影藏分配线
    public static void C2Lua_ActiveCameraSplitLine(bool active)
    {
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.ActiveCameraSplit", active);
    }

    public static void C2Lua_ShowOverUI()
    {
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.OpenOverUI");
    }

    public static void C2Lua_SuiPingFX(Vector3 angle,Transform parent,Vector3 pos)
    {
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.SuiPingFX", angle, parent,pos);
    }

    //C#2 Lua 
    //黑幕
    public static void C2Lua_FreshScreen(float t)
    {
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.FreshScreen", t);
    }

    public static void C2Lua_FreshSlgHp(bool bleft,int value,float progerss)
    {
        //Debug.LogFormat("{0} 扣血",progerss);
        DKLuaMgr.Instance.CallFunction("HeroBattle2C.FreshSLGHp", bleft, value,progerss);
    }
}
